﻿using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Noria.Web.Test
{
    [TestClass]
    public class CreationTimeTest
    {
        [TestMethod]
        public void SetCreationTime()
        {
            var root = @"K:\web\mymsdn\api\tmp\backup";
            var r = new Random();
            var t = 400;
            var today = DateTime.Today;

            while (t-- > 0)
            {
                today = today.AddDays(-1);
                var f = root + "\\" + r.Next().ToString();
                File.Create(f).Close();
                File.SetCreationTime(f, today);
            }
        }
    }
}
